// SpecDefManagerImp.h: interface for the SpecDefManagerImp class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SPECDEFMANAGERIMP_H__4AAE1107_3826_4461_BEAD_CBF80CEDB4B0__INCLUDED_)
#define AFX_SPECDEFMANAGERIMP_H__4AAE1107_3826_4461_BEAD_CBF80CEDB4B0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "SpecDefManage.h"

namespace Specification
{
	template
		<
		class SpecDefAssembler_
		>
	class SpecDefManagerImp : public SpecDefManage 
	{
	public:
		SpecDefManagerImp(){}
		virtual ~SpecDefManagerImp(){}
		
		virtual SpecDefPtr GetSpecDef(const StdString& strSpecKey){
			if (IsExist(strSpecKey))
			{
				return GetManaged(strSpecKey);
			}
			
			SpecDefAssembler_ assembler;
		    SpecDefPtr  pSpecDef;
			assembler.Read(strSpecKey, pSpecDef);
			if (pSpecDef == NULL)
			{
				return NULL;
			}
			Add(strSpecKey, pSpecDef);
			return pSpecDef;
		}
	public:

	}; 
}


#endif // !defined(AFX_SPECDEFMANAGERIMP_H__4AAE1107_3826_4461_BEAD_CBF80CEDB4B0__INCLUDED_)
